package shServer;

import java.net.*;
import java.io.*;

public class ServerMain 
{

	final static int maxClients = 3;
	
	public static void main(String [] args)
	{
		System.out.println("Sever Started");
		
		try
		{
			int i=1;
			ServerSocket s = new ServerSocket(8189);
			
			while (i <= maxClients )
			{
				Socket incoming= s.accept();
				Runnable r = new SensorServerThread(incoming);
				Thread t = new Thread(r);
				t.start();
				System.out.println("Spawning " + i);
				i++;
			}
		}
		catch(IOException e)
		{
			e.printStackTrace();
		}
	}
	
}
